{% set volumeUid = craft.app.projectConfig.get('users.photoVolumeUid') %}
{% if volumeUid %}
    <div class="user-photo" data-user="{{ user.id }}">
        <div id="current-photo">
            <img sizes="100px" srcset="{{ user.getThumbUrl(100) }} 100w, {{ user.getThumbUrl(200) }} 200w" alt="">
        </div>
        <div class="user-photo-controls">
            <input type="file" name="photo" class="hidden" />
            {% if user.photo %}
                <button type="button" class="btn upload-photo">{{ "Change photo"|t('app') }}</button>
                <button type="button" class="btn delete-photo">{{ "Delete photo"|t('app') }}</button><br><br>
                <button type="button" class="btn edit-photo" data-photoid="{{ user.photoId }}">{{ "Edit photo"|t('app') }}</button>
            {% else %}
                <button type="button" class="btn upload-photo">{{ "Upload a photo"|t('app') }}</button>
            {% endif %}
        </div>
    </div>
{% else %}
    <p>{{ 'Please set a volume for storing the user photos in user settings page first.'|t('app') }}</p>
{% endif %}
